package com.saladin.personalFinancialSystem.controller;

import com.saladin.personalFinancialSystem.model.FinancialRecord;
import com.saladin.personalFinancialSystem.model.FinancialRecordYear;
import com.saladin.personalFinancialSystem.service.FinancialRecordService;
import com.saladin.personalFinancialSystem.service.FinancialRecordYearService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/FinancialRecordYear")
public class FinancialRecordYearController {

    @Autowired
    private FinancialRecordYearService financialRecordYearService;
    /**
     * 获取商品的信息并且返回给客户端
     * @param userId
     * @return
     */
    @GetMapping("/QueryFinancialRecordYearList")
    public List<FinancialRecordYear> QueryFinancialRecordYearList(int userId) {
        List<FinancialRecordYear> financialRecordYearList = financialRecordYearService.queryFinancialRecordYearList(userId);
        return financialRecordYearList;
    }

}

